package com.woniu.ucenterservice.service.imp;

import com.woniu.ucenterservice.dao.MessageMapper;
import com.woniu.ucenterservice.dao.TypeMapper;
import com.woniu.ucenterservice.dao.UserMapper;
import com.woniu.ucenterservice.dao.UserMessageMapper;
import com.woniu.ucenterservice.pojo.Message;
import com.woniu.ucenterservice.pojo.Type;
import com.woniu.ucenterservice.service.MessageService;
import com.woniu.ucenterservice.vo.MessageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MessageServiceImp implements MessageService {
    @Autowired
    private MessageMapper messageMapper;
    private UserMapper userMapper;
    private UserMessageMapper userMessageMapper;
    private TypeMapper typeMapper;


    @Override
    public List<Message> selectAll(Integer userId, Integer currentPage, Integer pageSize, MessageVo vo) {
        List<Message> messages =  messageMapper.selectAllMessage(userId,currentPage,pageSize,vo);
        return messages;
    }

    @Override
    public Type selectMessageContent(Integer typeId) {
        Type type = messageMapper.selectContent(typeId);

        return type;
    }

    @Override
    public void delectMessage(Integer messageId) {
        messageMapper.deleteByPrimaryKey(messageId);
    }

    @Override
    public void batchDeleteUser(List<Integer> list) {
        messageMapper.batchDeleteUser(list);
    }
}
